/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import schema.Coordinate;
import schema.Disuguaglianze;

/**
 *
 * @author Antonio
 */
public class JButtonSimbol extends JButton {

    private Disuguaglianze stato;
    private int click;
    private Coordinate coordinataA;
    private Coordinate coordinataB;

    public JButtonSimbol(Coordinate coordinataA, Coordinate coordinataB) {

        super();
        this.coordinataA = coordinataA;
        this.coordinataB = coordinataB;
        click = 1;

        this.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {

                switch (click) {

                    case 0:
                        setText(" ");
                        stato = null;
                        click = 1;
                        return;
                    case 1:
                        setText(">");
                        stato = Disuguaglianze.GT;
                        click = 2;
                        return;
                    case 2:
                        setText("<");
                        stato = Disuguaglianze.LT;
                        click = 0;
                        return;
                    default:
                        return;
                }
            }
        });
    }

    public Disuguaglianze getStato() {
        return stato;
    }

    public Coordinate getCoordinataA() {
        return coordinataA;
    }

    public Coordinate getCoordinataB() {
        return coordinataB;
    }
}
